#pragma once

#include "iengine.h"

struct SDL_Surface;

namespace Core {

class WindowPrivate;

class Window
{
public:
    static Window* instance();

    /**
     * @brief pressed tests if key is pressed
     * @param key
     * @return true if such key pressed
     */
    bool pressed(SDLKey key);

    void init();
    void show();

    /**
     * @brief stop stops main loop before next event polled
     */
    void stop();

    /**
     * @brief enterLoop enters in game loop, loop ends when alt+F4 pressed
     */
    void enterLoop();

    /**
     * @brief resetEngine resets current game engine
     * @param engine
     */
    void resetEngine(IEngine *engine);

private:
    std::unique_ptr<WindowPrivate> d;

    Window();
    ~Window();
};

} // Core
